﻿using UnityEngine;
using System.Collections;
using System;

public class TimeSystem : Singleton<TimeSystem> {

    //private float systemTime = 0;
    public Int64 systemTime { get { return GetTimeStamp(false); } }
    public float deltaTime { get { return Time.deltaTime; } }
    public float gameTime { get { return Time.time; } }

	// Use this for initialization
    public override void Initialize()
    {
        //base.Initialize();
    }

    public override void Uninitialize()
    {
        //base.Uninitialize();
    }

    public Int64 GetTimeStamp(bool bflag = true)
    {
        TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
        Int64 ret = 0;
        if (bflag)
            ret = Convert.ToInt64(ts.TotalSeconds);
        else
            ret = Convert.ToInt64(ts.TotalMilliseconds);

        return ret;
    }  

}
